package com.ruoyi.project.system.domain;

import com.ruoyi.framework.web.domain.BaseEntity;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class SysUserProductPrice extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 定价ID
     */
    private Integer id;

    /**
     * 用户ID
     */
    @NotNull
    private Integer userId;

    /**
     * 产品ID
     */
    @NotNull
    private Integer productId;

    /**
     * 定制售价
     */
    private BigDecimal pricing;

    /**
     * 定制扣费
     */
    private BigDecimal fee;

    public SysUserProductPrice() {
    }

    public SysUserProductPrice(Integer userId, Integer productId, SysProduct sysProduct) {
        this.userId = userId;
        this.productId = productId;
        this.pricing = sysProduct.getPricing();
        this.fee = sysProduct.getFee();
    }
}
